
classDiagram
    class Main {
        +main() str
    }
    class Game {
        -Board board
        -Difficulty difficulty
        -int score
        -bool game_over
        +start()
        +update()
        +check_game_over() bool
        +reset_game()
    }
    class Board {
        -int size
        -list tiles
        +init_board()
        +move_tiles(direction: str) bool
        +add_new_tile()
        +get_available_cells() list
        +get_score() int
    }
    class Difficulty {
        -str level
        -int board_size
        -int win_value
        +get_difficulty() str
        +set_difficulty(level: str)
    }
    class UI {
        +display_score(score: int)
        +display_game_over()
        +display_restart_button()
        +render_board(board: Board)
        +handle_input(event: pygame.event)
    }
    class Constants {
        +dict COLORS
        +int TILE_SIZE
        +int MARGIN
        +dict DIRECTIONS
    }
    Main --> Game
    Game --> Board
    Game --> Difficulty
    Game --> UI
    UI --> Constants
